//
//  OrderTabCell.m
//  ShopDemo
//
//  Created by Sunshine on 2018/7/25.
//  Copyright © 2018年 飞扬的青春. All rights reserved.
//

#import "OrderTabCell.h"

@implementation OrderTabCell

- (void)awakeFromNib {
    [super awakeFromNib];
   
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {

        UIImageView *titimageview = [UIImageView new];
        self.titimagevi = titimageview;
        [self.contentView addSubview:titimageview];
        titimageview.sd_layout
        .topSpaceToView(self.contentView,10*kJLXWidthScale)
        .leftSpaceToView(self.contentView, 10*kJLXWidthScale)
        .bottomSpaceToView(self.contentView, 10*kJLXWidthScale)
        .widthIs(80*kJLXWidthScale);
        
        UILabel *titlab = [UILabel new];
        self.titlab = titlab;
        titlab.font = [UIFont systemFontOfSize:16*kJLXWidthScale];
        [self.contentView addSubview:titlab];
        titlab.sd_layout
        .topSpaceToView(self.contentView, 8*kJLXWidthScale)
        .leftSpaceToView(titimageview, 8*kJLXWidthScale)
        .rightSpaceToView(self.contentView, 8*kJLXWidthScale)
        .heightIs(30*kJLXWidthScale);
        
        UILabel *cklab = [UILabel new];
        self.cklab = cklab;
        cklab.textColor = [UIColor lightGrayColor];
        cklab.font = [UIFont systemFontOfSize:13*kJLXWidthScale];
        [self.contentView addSubview:cklab];
        cklab.sd_layout
        .topSpaceToView(titlab, 0)
        .leftSpaceToView(titimageview, 8*kJLXWidthScale)
        .rightSpaceToView(self.contentView, 8*kJLXWidthScale)
        .heightIs(20*kJLXWidthScale);
        
        UILabel *pricelab = [UILabel new];
        self.pricelab = pricelab;
        [self.contentView addSubview:pricelab];
        pricelab.sd_layout
        .topSpaceToView(cklab, 0)
        .leftSpaceToView(titimageview, 8*kJLXWidthScale)
        .widthIs(100*kJLXWidthScale)
        .heightIs(30*kJLXWidthScale);
        
        UILabel *numlab = [UILabel new];
        self.numlab = numlab;
        numlab.textAlignment = NSTextAlignmentRight;
        numlab.font = [UIFont systemFontOfSize:16*kJLXWidthScale];
        [self.contentView addSubview:numlab];
        numlab.sd_layout
        .topSpaceToView(pricelab, 0)
        .rightSpaceToView(self.contentView, 10*kJLXWidthScale)
        .widthIs(80*kJLXWidthScale)
        .heightIs(20*kJLXWidthScale);
        
//        UIView *thirdline = [UIView new];
//        thirdline.backgroundColor = LineBackColor;
//        [self.contentView addSubview:thirdline];
//        thirdline.sd_layout
//        .topSpaceToView(numlab, 8*kJLXWidthScale)
//        .leftSpaceToView(self.contentView, 0)
//        .rightSpaceToView(self.contentView, 0)
//        .heightIs(1);
//        
//        for (int i = 0; i < 2; i ++) {
//            MineButton *btn = [MineButton buttonWithType:UIButtonTypeCustom];
//            [self.contentView addSubview:btn];
//            if (i == 0) {
//                [btn setTitle:@"去支付" forState:UIControlStateNormal];
//                btn.sd_layout
//                .topSpaceToView(thirdline, 5*kJLXWidthScale)
//                .rightSpaceToView(self.contentView, 8*kJLXWidthScale)
//                .heightIs(30*kJLXWidthScale)
//                .widthIs(70*kJLXWidthScale);
//            }else{
//                 [btn setTitle:@"取消订单" forState:UIControlStateNormal];
//                btn.sd_layout
//                .topSpaceToView(thirdline, 5*kJLXWidthScale)
//                .rightSpaceToView(self.contentView, 85*kJLXWidthScale)
//                .heightIs(30*kJLXWidthScale)
//                .widthIs(100*kJLXWidthScale);
//            }
//        }
//        
//        UILabel *sumlab = [UILabel new];
//        self.sumlab = sumlab;
//        sumlab.text = @"订单合计：￥38.5";
//        sumlab.textColor = LineBackColor;
//        [self.contentView addSubview:sumlab];
//        sumlab.sd_layout
//        .topSpaceToView(thirdline, 0)
//        .rightSpaceToView(self.contentView,200*kJLXWidthScale)
//        .heightIs(40*kJLXWidthScale)
//        .widthIs(130*kJLXWidthScale);
    }
    return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
